
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObject;
using DataAccessLayer;

namespace BusinessLogic
{
    /// <summary>
    /// Define PhieuBanHangUtil class. This class user for BussinessLayer.

    /// </summary>
    public class PhieuBanHangUtil
    {
        /// <summary>
        /// Define function Insert for PhieuBanHang Object.
        /// </summary>
        /// <param name="t">object data need Insert.</param>
        /// <returns>
        ///    True: if insert successfull.
        ///    False: if insert error.
        ///</returns>
        public static bool Insert(PhieuBanHang t)
        {

            return PhieuBanHangDao.Insert(t);
        }
        /// <summary>
        /// Define function Update for PhieuBanHang Object.
        /// </summary>
        /// <param name="t">project data need updated.</param>
        /// <returns>
        ///    True: if update successful.
        ///    False: if update Error.
        ///</returns>
        public static bool Update(PhieuBanHang t)
        {

            return PhieuBanHangDao.Update(t);
        }
        /// <summary>
        /// Get All PhieuBanHang object from table PhieuBanHang.
        /// </summary>
        /// <returns>List PhieuBanHang object.</returns>
        public static List<PhieuBanHangResult> GetAll()
        {
            return PhieuBanHangDao.GetAll();
        }
        /// <summary>
        /// Search PhieuBanHang object in table PhieuBanHang.
        /// </summary>
        /// <param name="t">Condition for Search.</param>

        /// <returns>List PhieuBanHangResult objects.</returns>

        public static List<PhieuBanHangResult> SearchPhieuBanHangSomeCondition(PhieuBanHang t)
        {
            return PhieuBanHangDao.SearchPhieuBanHangSomeCondition(t);
        }
        /// <summary>
        /// Get a PhieuBanHang data object by primary key. 
        /// </summary>
        /// <param name="maPhieuBanHang" >This is primary key.</param>
        /// <returns>A PhieuBanHang object.</returns>

        public static PhieuBanHang Get(Int64 maPhieuBanHang)
        {
            return PhieuBanHangDao.Get(maPhieuBanHang);
        }
        /// <summary>
        /// This function to Delete PhieuBanHang object by primary key.
        /// </summary>
        /// <param name="maPhieuBanHang" >This is primary key.</param>
        /// <returns>If succesful return True else  return False.</returns>

        public static bool Delete(Int64 maPhieuBanHang)
        {

            return PhieuBanHangDao.Delete(maPhieuBanHang);
        }
        public static Int64 Insert(PhieuBanHang obj,KhachHang objKH, List<ChiTietPhieuBanHang> lstChiTiet)
        {
            return PhieuBanHangDao.Insert(obj,objKH, lstChiTiet);
        }
        public static bool Update(PhieuBanHang obj, KhachHang objKhachHang, List<ChiTietPhieuBanHang> lstChiTiet)
        {
            return PhieuBanHangDao.Update(obj, objKhachHang, lstChiTiet);
        }
        public static List<ChiTietPhieuBanHangDetail> GetChiTietPhieuBanHangDetailByMaPhieuBanHang(Int64 maPhieu)
        {
            return ChiTietPhieuBanHangDao.GetChiTietPhieuBanHangDetailByMaPhieuBanHang(maPhieu);
        }
        public static Curency GetCurencyForPhieuBanHang(Int64 maPhieu)
        {
            return PhieuBanHangDao.GetCurencyForPhieuBanHang(maPhieu);
        }
    }
}